package book_management.operation.impl;

import book_management.book.Book;
import book_management.book.BookList;
import book_management.operation.IOperation;

public class FindOperation implements IOperation {
    //查找书籍
    @Override
    public void work(BookList bookList) {
        System.out.println("你现在进行的是查找操作");
        System.out.println("请输入你要查找的书名：");
        String bookName = scanner.next();
        if (bookList.contains(bookName)){
            Book book = bookList.find(bookName);
            System.out.println(bookName+"的信息为：");
            System.out.println(book);
        }else {
            System.out.println("没有这本书");
        }
    }
}
